/************************* 
*** File myHashCode.c 
**************************/  
#include "myHashCode.h"  
  
  
//int类型hashCode  
int myHashCodeInt(int a, int Capacity)  
{  
    a %= Capacity;
    if(a<0) a += Capacity;
    return a;
}  
  
//char类型的hashCode  
int myHashCodeChar(char a, int C)  
{  
    return myHashCodeInt(a, C);
}  
  
//string类型的hashCode  
int myHashCodeString(void *a, int C)  
{  
    int re = 0;  
    char *aa = (char *) a;  
    while (*aa)  
    {  
        re += HASHCODE_MULT * *aa;  
        aa++;  
    }  
    return myHashCodeInt(re, C);  
}


